package com.dg.river.module.main.fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.dg.river.contant.CommonCode;
import com.dg.river.databinding.FragmentHomeBinding;
import com.dg.river.module.base.BaseFragment;
import com.dg.river.module.common.bean.EbMessage;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * @作者：HuYong
 * @时间：2023/4/12 16:19
 * @描述：首页
 * @xml：fragment_home.xml
 * @修改：
 */
public class HomeFragment extends BaseFragment {

    private FragmentHomeBinding binding;

    @Override
    protected void initGetIntent() {

    }

    @Override
    public View initLayout(LayoutInflater inflater, ViewGroup container) {
        binding = FragmentHomeBinding.inflate(inflater, container, false);
        return binding.getRoot();
    }

    @Override
    public void initView() {
        // 注册消息通知
        EventBus.getDefault().register(this);
    }

    @Override
    public boolean viewAndData() {
        return true;
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {

    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(EbMessage message) {
        if (CommonCode.EventBus.REFRESH_MAIN_QUICK_MESSAGE.equals(message.getMsg())) {

        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
}
